package com.itita.ww2.model.worldmap.enums;

public enum StatusEnum {
	DEFAULT(0), // 默认
	UNDER_ATTACK, // 正在被攻击
	// OCCUPIED // 已经被占领
	;

	private int value;

	private StatusEnum() {
		this(Counter.nextValue);
	}

	private StatusEnum(int value) {
		this.value = value++;
		Counter.nextValue = value;
	}

	public int getValue() {
		return value;
	}

	public static StatusEnum intValueOf(int status) {
		for (StatusEnum ret : values()) {
			if (ret.getValue() == status) {
				return ret;
			}
		}
		return null;
	}

	private static class Counter {
		private static int nextValue = 0;
	}
}
